Component({
    properties: {
        goods: {
            type: null
        },
        text: {
            type: null
        },
        num: {
            type: null
        },
        loading: {
            type: null
        }
    },
    data: {
        language: "",
        selectedGoodsID: [],
        selectedGoods: []
    },
    lifetimes: {
        attached: function() {
            var e = wx.getStorageSync("langIndex");
            this.setData({
                language: e.en
            });
        },
        moved: function() {},
        detached: function() {}
    },
    attached: function() {},
    ready: function() {},
    pageLifetimes: {
        show: function() {},
        hide: function() {},
        resize: function() {}
    },
    methods: {
        gogoods: function(e) {
            var t = e.currentTarget.dataset.id;
            wx.navigateTo({
                url: "/packageA/detail_v2/detail_v2?id=" + t
            });
        },
        addGood: function(e) {
            var t = this, a = e.currentTarget.dataset.id, d = !0;
            this.data.selectedGoods.map(function(e) {
                e.id == a && (d = !1, e.value = !e.value, e.value ? t.data.selectedGoodsID.push(a) : t.data.selectedGoodsID = t.data.selectedGoodsID.filter(function(e) {
                    return e != a;
                }));
            });
            var o = {
                id: a,
                value: d
            };
            d && (this.data.selectedGoodsID.push(a), this.data.selectedGoods.push(o)), this.setData({
                selectedGoodsID: this.data.selectedGoodsID,
                selectedGoods: this.data.selectedGoods
            }), this.triggerEvent("selectTotal", this.data.selectedGoods);
        }
    }
});